/*
 * AdminSession
 * Buisness functions for create, remove update person information
 */
package edu.depaul.se.courseregistration.sessionbean;

import edu.depaul.se.courseregistration.jpa.user.Person;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 *
 * @author Group2
 */

@Stateless
@LocalBean
public class AdminSession {

     @EJB
     private AdminEJB adminEJB;
     
     @EJB
     private PersonEJB personEJB;
    
     // Admin business APIs to create, remove, or edit person
    
    public void removePerson(int personID)
    {
        adminEJB.removePerson(personID);
    }
    
  

    public Person createPerson(String personType, String strAddress, String city, String state, String zip, String major, String deptName, String firstName, String lastName, String email, int personId) {
        return adminEJB.createPerson(personType, strAddress, city, state, zip, major, deptName, firstName, lastName, email, personId);
    }

    public void editPerson(String personType, String strAddress, String city, String state, String zip, String major, String deptName, String firstName, String lastName, String email, int personId) {
        Person pesron = personEJB.findPersonById(personId);
        adminEJB.editPerson(personType, strAddress, city, state, zip, major, deptName, firstName, lastName, email, pesron);
    }
}
